package com.qfjy.homework.songyu.strategypattern;

/**
 * @version : 1.0
 * @author:宋煜
 * @date: 2022/5/9 19:58
 * 三人分别调用不同的方式导航
 */
public class TestPattern {
    public static void main(String[] args) {
        Person personWang = new Person("小王",16);
        Person personSong = new Person("小宋",17);
        Person personWu = new Person("小吴",18);

        NavigationPattern pattern1  = new NavigationWithBike();
        personWang.navigationPattern = pattern1;
        personWang.useNavigation();

        NavigationPattern pattern2  = new NavigationWithCar();
        personSong.navigationPattern = pattern2;
        personSong.useNavigation();

        NavigationPattern pattern3  = new NavigationWithLeg();
        personWu.navigationPattern = pattern3;
        personWu.useNavigation();
    }
}
